Light-emitting diodes (LEDs) are semiconductor diodes that are designed to emit light of a particular wavelength when properly biased. Currently, LEDs are used in a variety of electronic devices for informational display, aesthetic display, or simply to provide light.
In general operation, an LED is either on (i.e., it is properly biased and is giving off light), or it is off (i.e., it is not properly biased and is off). Thus, when turned on, there is only one real intensity at which an LED can shine—its full intensity.
However, it is possible to create the appearance that the LED is being lit at a lower intensity by very quickly turning the LED on and off at a speed not discernable to the naked eye. The rapid switching of the diode on and off will reduce the total amount of light that the LED emits over a short period of time, making it seem as if the LED is actually emitting light at an intensity lower than the full intensity it would emit were it on continually.
This can be accomplished by generating a control signal for the LED that is rapidly changed from an on value that will bias the LED and turn it on to an off value that will turn the LED off. The exact frequency and duration at which the control signal turns the LED on will determine the perceived intensity of the LED.
This phenomenon can also be used to make it appear as if the LED is moving more gradually from an off state to a fully on state. If an LED is simply turned fully on or fully off, the transition between off and on will be abrupt, which can be displeasing to the eye. But by slowly increasing the amount of time that an LED is turned on over a set duration from constantly off state (i.e., gradually increasing its duty cycle from zero to 100%), the LED can be made to appear as if it is slowly fading from off to its maximum intensity. Likewise, by slowly decreasing the amount of time that an LED is turned on over a set duration from a constantly on state (i.e., gradually decreasing its duty cycle from 100% to zero), the LED can be made to appear as if it is slowly fading from its maximum intensity to off.
In order to accomplish this, however, it is necessary to generate an LED control signal that has a proper shape to appropriately vary the duty cycle of the LED to achieve a desired level of fading. Typically this is done by filling a set of registers with the data required to generate an appropriate LED control signal that will provide the desired duty cycle pattern for the required fading.
However, this approach is inherently limited in that only those fading patterns that are stored in memory can be used. Furthermore, changing fading patterns requires the loading of an entire new fading pattern in the control registers, which takes time and system resources.
It would therefore be desirable to provide a way to automatically vary the duty cycle of an LED in a manner that allows a variety of fading parameters to be easily varied.